from tortoise import fields
from tortoise.models import Model


class Mirror_forest(Model):
    id = fields.IntField(pk=True)
    content = fields.TextField(description="内容")
    source = fields.CharField(max_length=255, description="出处")
    presentation_style = fields.CharField(max_length=255, description="展现样式")
    update_time = fields.DatetimeField(auto_now_add=True, description="更新时间")

    def __str__(self):
        return self.id

    class Meta:
        db_table = "wise_counsel"
        table_description = "镜子森林表"


class Mirror_Opening(Model):
    id = fields.IntField(pk=True)
    user_id = fields.IntField(description="用户id")
    mirror_id = fields.IntField(description="镜子id")
    open_time = fields.DatetimeField(auto_now_add=True, description="开镜时间")

    def __str__(self):
        return self.id

    class Meta:
        db_table = "mirror_open"
        table_description = "用户开镜表"


